Skip to content

refactor(app-tools): unify ESM TypeScript path resolution#8530

Merged
zllkjc merged 5 commits intomainfrom
feat/esm-alias
Apr 10, 2026
Merged

refactor(app-tools): unify ESM TypeScript path resolution#8530
zllkjc merged 5 commits intomainfrom
feat/esm-alias

Conversation

@zllkjc
Copy link
Copy Markdown
Member

@zllkjc zllkjc commented Apr 9, 2026

Summary

This PR unifies ESM TypeScript path resolution across runtime loaders and build-time transforms.

It moves runtime path normalization into a single setup path, so ts-node and native Node loaders now consume the same baseUrl + paths input.

It also aligns alias resolution and .js -> .ts fallback behavior across runtime and compile flows, keeps native ESM output on .js specifiers, and simplifies the loader/helper structure by removing redundant wrapper code and
trimming duplicate tests.

中文版:

本 PR 统一了 ESM 场景下运行时与构建期的 TypeScript 路径解析逻辑

  1. 将运行时的路径归一化收敛到同一条逻辑链路,使 ts-node loader 和 Node native loader 统一消费同一份 baseUrl + paths 配置
  2. 对齐 alias、tsconfig paths 以及 .js -> .ts fallback 的解析行为,保证 runtime 和 compile 的表现一致
  3. type: module 场景下统一输出 Node 可直接运行的 .js specifier
  4. 删除多余的中间 helper 和重复测试,并补充相关回归用例,简化整体实现

Related Links

Checklist

  • I have added changeset via pnpm run change.
  • I have updated the documentation.
  • I have added tests to cover my changes.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 9, 2026

⚠️ No Changeset found

Latest commit: a87a512

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 9, 2026

Deploy Preview for modernjs-byted ready!

Name Link
🔨 Latest commit a87a512
🔍 Latest deploy log https://app.netlify.com/projects/modernjs-byted/deploys/69d8b4610473bc000817653c
😎 Deploy Preview https://deploy-preview-8530--modernjs-byted.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 94 (🔴 down 4 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

Rsdoctor Bundle Diff Analysis

📊 Quick Summary
Project Total Size Change
bundle-diff 2.9 MB 0

Generated by Rsdoctor GitHub Action

@zllkjc zllkjc enabled auto-merge (squash) April 10, 2026 09:54
@zllkjc zllkjc merged commit cde3dde into main Apr 10, 2026
10 checks passed
@zllkjc zllkjc deleted the feat/esm-alias branch April 10, 2026 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants